import 'package:flutter/material.dart';
import 'package:flutter_douban/config/app_colors.dart';
import 'package:flutter_douban/model/recipe_big_model.dart';

class CookDetailNavFootter extends StatefulWidget {
  final RecipeBigModel model;
  // final CookInfoModel model;

  const CookDetailNavFootter({Key? key, required this.model}) : super(key: key);

  @override
  _CookDetailNavFootterState createState() => _CookDetailNavFootterState();
}

class _CookDetailNavFootterState extends State<CookDetailNavFootter> {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: kToolbarHeight,
      width: MediaQuery.of(context).size.width,
      padding: EdgeInsets.only(left: 20, right: 10),
      decoration: BoxDecoration(
        color: Colors.white,
        boxShadow: [
          BoxShadow(
            color: Colors.black26, //底色,阴影颜色
            offset: Offset(0, 0), //阴影位置,从什么位置开始
            blurRadius: 14, // 阴影模糊层度
            spreadRadius: 5,
          ) //阴影模糊大小
        ],
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [_rightWidget(), _leftWidget()],
      ),
    );
  }

  Widget _rightWidget() {
    return Container(
      alignment: Alignment.centerLeft,
      width: 150,
      height: 36,
      decoration: BoxDecoration(
        color: AppColors.line,
        borderRadius: BorderRadius.circular(20),
      ),
      child: Text(
        '     ' + '说点什么' + '...',
        style: TextStyle(fontSize: 14, color: AppColors.black),
      ),
    );
  }

  Widget _leftWidget() {
    return Row(
      children: [
        _itemWidget('icon_home_comment', '1'),
        _itemWidget('icon_home_collection', '收藏'),
        _itemWidget('bottom_recipe_dish', '传学做'),
      ],
    );
  }

  Widget _itemWidget(String icon, String name) {
    return Container(
      padding: EdgeInsets.only(left: 4, right: 4),
      child: Row(
        children: [
          Image.asset(
            'assets/images/common/${icon}.png',
            width: 22,
            height: 22,
          ),
          SizedBox(
            width: 5,
          ),
          Text(
            name,
            style: TextStyle(fontSize: 13, color: Colors.black),
          )
        ],
      ),
    );
  }
}
